package com.fxc;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

import com.fxc.TankFrame;
import com.fxc.tank.abstractfactory.BaseExplode;

public class Explods extends BaseExplode{
	
	// 爆炸的大小
	public static final int WIDTH  = ResourceManager.explods[0].getWidth();
	
	public static final int HEIGHT = ResourceManager.explods[0].getHeight();
		
	private int x, y;
	
	private Dir dir;
	
	TankFrame tf = null;
	
	// 画的步数
	private int step = 0;

	public Explods(int x, int y, TankFrame tf) {
		super();
		this.x = x;
		this.y = y;
		this.tf = tf;
	}
	
	@Override
	public void paint(Graphics g) {
		
		g.drawImage(ResourceManager.explods[step++], x, y, null);
		
		if (step >= ResourceManager.explods.length) {
			tf.explods.remove(this);
		}
	}
	
}
